let apiKey = "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";

async function sendMsg(msg) {
  // To use ESM in CommonJS, you can use a dynamic import
  const { ChatGPTAPI } = await import("chatgpt");

  const api = new ChatGPTAPI({ apiKey: apiKey });

  const res = await api.sendMessage(msg);
  console.log(res.text);
  return res;
}
module.exports = sendMsg;
